/* ------------------------------------------------------------------------------------------------------*/
/* ------------------------------------SWAP order of some faces------------------------------------------*/
/* ------------------------------------------------------------------------------------------------------*/

if(grid==1){
{register int field, grid_ind1, grid_ind2;
 for (field = 0; field < N_FIELDS_MPI; field++){
     for (grid_ind1 = ni_1; grid_ind1 < nf_1; ++grid_ind1){
     sfield_send.s_y_0_u[field][grid_ind1]=
	 sfield_recv.s_y_0_u[field][grid_ind1];
     }
     for (grid_ind1 = ni_1; grid_ind1 < nf_1; ++grid_ind1){
     sfield_recv.s_y_0_u[field][grid_ind1]=
	 sfield_send.s_y_0_u[field][nf_1-1+ni_1-grid_ind1];
     }
}}
};

 if(grid==2){
{register int field, grid_ind1, grid_ind2;
 for (field = 0; field < N_FIELDS_MPI; field++){
     for (grid_ind1 = ni_1; grid_ind1 < nf_1; ++grid_ind1){
       sfield_send.s_y_0_u[field][grid_ind1]=
	   sfield_recv.s_y_0_u[field][grid_ind1];
       sfield_send.s_y_1_u[field][grid_ind1]=
	   sfield_recv.s_y_1_u[field][grid_ind1];
     }
     for (grid_ind1 = ni_1; grid_ind1 < nf_1; ++grid_ind1){
     sfield_recv.s_y_0_u[field][grid_ind1]=
	 sfield_send.s_y_0_u[field][nf_1-1+ni_1-grid_ind1];
     sfield_recv.s_y_1_u[field][grid_ind1]=
	 sfield_send.s_y_1_u[field][nf_1-1+ni_1-grid_ind1];
     }
}}
 };

if(grid==3){
{register int field, grid_ind1, grid_ind2;
 for (field = 0; field < N_FIELDS_MPI; field++){
     for (grid_ind1 = ni_1; grid_ind1 < nf_1; ++grid_ind1){
     sfield_send.s_y_1_u[field][grid_ind1]=
	 sfield_recv.s_y_1_u[field][grid_ind1];
     }
     for (grid_ind1 = ni_1; grid_ind1 < nf_1; ++grid_ind1){
     sfield_recv.s_y_1_u[field][grid_ind1]=
	 sfield_send.s_y_1_u[field][nf_1-1+ni_1-grid_ind1];
     }
   }}
 };

if(grid==4){
{register int field, grid_ind1, grid_ind2;
 for (field = 0; field < N_FIELDS_MPI; field++){
     for (grid_ind2 = ni_2; grid_ind2 < nf_2; ++grid_ind2){
     sfield_send.s_x_0_u[field][grid_ind2]=
	 sfield_recv.s_x_0_u[field][grid_ind2];
     }
     for (grid_ind2 = ni_2; grid_ind2 < nf_2; ++grid_ind2){
     sfield_recv.s_x_0_u[field][grid_ind2]
	 =sfield_send.s_x_0_u[field][nf_2-1+ni_2-grid_ind2];
     }
     for (grid_ind1 = ni_1; grid_ind1 < nf_1; ++grid_ind1){
     sfield_send.s_y_1_u[field][grid_ind1]=
	 sfield_recv.s_y_1_u[field][grid_ind1];
     }
     for (grid_ind1 = ni_1; grid_ind1 < nf_1; ++grid_ind1){
     sfield_recv.s_y_1_u[field][grid_ind1]=
	 sfield_send.s_y_1_u[field][nf_1-1+ni_1-grid_ind1];
     }
   }}
 };
 if(grid==5){
{register int field, grid_ind1, grid_ind2;
 for (field = 0; field < N_FIELDS_MPI; field++){
     for (grid_ind2 = ni_2; grid_ind2 < nf_2; ++grid_ind2){
     sfield_send.s_x_1_u[field][grid_ind2]=
	 sfield_recv.s_x_1_u[field][grid_ind2];
     }
     for (grid_ind2 = ni_2; grid_ind2 < nf_2; ++grid_ind2){
     sfield_recv.s_x_1_u[field][grid_ind2]=
	 sfield_send.s_x_1_u[field][nf_2-1+ni_2-grid_ind2];
     }
     for (grid_ind1 = ni_1; grid_ind1 < nf_1; ++grid_ind1){
     sfield_send.s_y_0_u[field][grid_ind1]=
	 sfield_recv.s_y_0_u[field][grid_ind1];
     }
     for (grid_ind1 = ni_1; grid_ind1 < nf_1; ++grid_ind1){
     sfield_recv.s_y_0_u[field][grid_ind1]=
	 sfield_send.s_y_0_u[field][nf_1-1+ni_1-grid_ind1];
     }
   }}
 };
